#ifndef INCLUDED_FIGHTER_H //if not , define
#define INCLUDED_FIGHTER_H

#include "SGE.h"
using namespace SGE;

#include "CharacterState.h"

enum AnimationState
{
	AS_None = -1,
	AS_Idle,
	AS_JabRight,
	AS_JabLeft,
	AS_DodgeRight,
	AS_DodgeLeft,
	AS_HookLeft,
	AS_HookRight,
	AS_Hurt,
	AS_Flinch,
	AS_Max
};


class fighter
{
public:
	fighter();
	~fighter();

	void Load(const char* pfighter); //initialize
	void Unload(); //terminate
	void Update(float deltaTime);
	void Render(const SVector2& offset);

	void ChangeState(AnimationState as);
	const char* GetCurrentState();
	int GetIntState();

	//Mutators
	void SetPosition(const SVector2& pos) {mPosition = pos;}
	void SetFacingLeft(bool facingLeft)		{ mFacingLeft = facingLeft; }
	void SetJabRightKey(int key)		{ mRJabKey = key; }
	void SetHurtKey(int key)		{ mHurtKey = key; }
	void SetFlinchKey(int key)		{ mFlinchKey = key; }
	void SetJabLeftKey(int key)		{ mLJabKey = key; }
	void SetHookRightKey(int key)		{ mRHookKey = key; }
	void SetHookLeftKey(int key)		{ mLHookKey = key; }
	void SetDodgeRightKey(int key)		{ mRDodgeKey = key; }
	void SetDodgeLeftKey(int key)		{ mLDodgeKey = key; }

	//Accessors
	const SVector2& GetPosition() const   { return mPosition;}
	SRect GetBoundingBox() const;
	SRect GetDamageBox() const;
	bool IsFacingLeft() const				{ return mFacingLeft; }

	int GetJabRightKey() const		{ return mRJabKey; }
	int GetHurtKey() const		{ return mHurtKey; }
	int GetFlinchKey() const		{ return mFlinchKey; }
	int GetJabLeftKey() const		{ return mLJabKey; }
	int GetHookRightKey() const		{ return mRHookKey; }
	int GetHookLeftKey() const		{ return mLHookKey; }
	int GetDodgeRightKey() const		{ return mRDodgeKey; }
	int GetDodgeLeftKey() const		{ return mLDodgeKey; }

private:
	CharacterState* mCharacterStates[AS_Max];
	CharacterState* mpCurrentState;
	const char* mfighter;
	int CurState;
	SGE_Sprite* mSprite;
	SVector2 mPosition;
	bool mFacingLeft;
	int mRJabKey;
	int mLJabKey;
	int mRHookKey;
	int mLHookKey;
	int mRDodgeKey;
	int mLDodgeKey;
	int mHurtKey;
	int mFlinchKey;

};


#endif INCLUDED_FIGHTER_H